
// -----------------------------------------------------------------------------

#pragma once

#include <Windows.h>
#include <tchar.h>

namespace Kif
{
namespace Win32
{
namespace System
{

class SystemUser
{
private:
   HANDLE hToken;   // handle to token
public:

   SystemUser();
  ~SystemUser();

   void Dispose();
   inline HANDLE GetTokenHandle()
   {
      return hToken;
   }

   bool GetCurrentUserToken();

   bool IsProcessElevated(HANDLE hToken);
   inline bool IsProcessElevated()
   {
      return IsProcessElevated(NULL);
   }

   TOKEN_ELEVATION_TYPE GetProcessElevationType(HANDLE hToken);

   static void ExecuteAsAdministrator(TCHAR *command, TCHAR *parameters);
}  ;  // end of SystemUser

}  // end of namespace Kif::Win32::System
}  // end of namespace Kif::Win32
}  // end of namespace Kif


